﻿/*!
 * EF Frontrunner Client-side Framework
 * Author: BenQ Guru
 */
var EF = EF || {};
EF.Frontrunner = EF.Frontrunner || {};
EF.Frontrunner.Activity = EF.Frontrunner.Activity || {};
EF.Frontrunner.Activity.Interface = EF.Frontrunner.Activity.Interface || {};
EF.Frontrunner.Activity.Common = EF.Frontrunner.Activity.Common || {};
EF.Frontrunner.Activity.Framework = EF.Frontrunner.Activity.Framework || {};
EF.Frontrunner.Activity.Common = EF.Frontrunner.Activity.Common || {};
EF.Frontrunner.Activity.Common.Clock = EF.Frontrunner.Activity.Common.Clock || {};
EF.Frontrunner.Activity.Common.Clock = {
	_currentDateTime: 0
};
EF.Frontrunner.Activity.Common.isDebug = false;
EF.Frontrunner.Activity.Common.AddCanvasElement = function(b) {
	var a = document.createElement("canvas");
	b.appendChild(a);
	a.id = "" + parseInt(Math.random() * 100000) + parseInt(Math.random() * 1000);
	return a
};
EF.Frontrunner.Activity.Common.DrawLine = function(b, d, h, c, g) {
	var e = b.getContext("2d");
	var f = h.x - d.x;
	var a = h.y - d.y;
	if (f < 0) {
		f = -1 * f
	}
	if (a < 0) {
		a = -1 * a
	}
	if (a <= g) {
		a = g + 1
	}
	b.width = f;
	b.height = a;
	e.beginPath();
	e.lineWidth = g;
	e.strokeStyle = c;
	if (d.x <= h.x && d.y <= h.y) {
		e.moveTo(0, 0);
		e.lineTo(f, a)
	} else {
		if (d.x < h.x && d.y > h.y) {
			e.moveTo(0, a);
			e.lineTo(f, 0)
		} else {
			if (d.x > h.x && d.y > h.y) {
				e.moveTo(f, a);
				e.lineTo(0, 0)
			} else {
				if (d.x > h.x && d.y < h.y) {
					e.moveTo(f, 0);
					e.lineTo(0, a)
				}
			}
		}
	}
	e.stroke();
	return b
};
EF.Frontrunner.Activity.Common.DrawDashLine = function(l, a, h, e, j) {
	var c = l.getContext("2d");
	var b = h.x - a.x;
	var n = h.y - a.y;
	if (b < 0) {
		b = -1 * b
	}
	if (n < 0) {
		n = -1 * n
	}
	if (n <= j) {
		n = j + 1
	}
	l.width = b;
	l.height = n;
	c.beginPath();
	c.lineWidth = j;
	c.strokeStyle = e;
	var m = 0;
	var g = Math.sqrt(b * b + n * n) / 2;
	if (a.x <= h.x && a.y <= h.y) {
		c.moveTo(0, 0);
		for (m = 1; m <= g; m += 2) {
			var k = b * m * 1 / g;
			var i = n * m * 1 / g;
			var f = b * (m + 1) * 1 / g;
			var d = n * (m + 1) * 1 / g;
			c.lineTo(k, i);
			c.moveTo(f, d)
		}
	} else {
		if (a.x < h.x && a.y > h.y) {
			c.moveTo(0, n);
			for (m = 1; m <= g; m += 2) {
				var k = b * m * 1 / g;
				var i = n - n * m * 1 / g;
				var f = b * (m + 1) * 1 / g;
				var d = n - n * (m + 1) * 1 / g;
				c.lineTo(k, i);
				c.moveTo(f, d)
			}
		} else {
			if (a.x > h.x && a.y > h.y) {
				c.moveTo(b, n);
				for (m = 1; m <= g; m += 2) {
					var k = b - b * m * 1 / g;
					var i = n - n * m * 1 / g;
					var f = b - b * (m + 1) * 1 / g;
					var d = n - n * (m + 1) * 1 / g;
					c.lineTo(k, i);
					c.moveTo(f, d)
				}
			} else {
				if (a.x > h.x && a.y < h.y) {
					c.moveTo(b, 0);
					for (m = 1; m <= g; m += 2) {
						var k = b - b * m * 1 / g;
						var i = n * m * 1 / g;
						var f = b - b * (m + 1) * 1 / g;
						var d = n * (m + 1) * 1 / g;
						c.lineTo(k, i);
						c.moveTo(f, d)
					}
				}
			}
		}
	}
	c.stroke();
	return l
};
EF.Frontrunner.Activity.Common.fitBackgroundHeight = function() {
	$(window).resize()
};
EF.Frontrunner.Activity.Common.disableSelection = function(a) {
	$(a).bind($.support.selectstart ? "selectstart" : "mousedown", function(b) {
		return false
	})
};
EF.Frontrunner.Activity.Common._purge = function(e) {
	if (!e) {
		return
	}
	var d = e.attributes,
		c, b, a;
	if (d) {
		b = d.length;
		for (c = 0; c < b; c += 1) {
			a = d[c].name;
			if (typeof e[a] === "function") {
				e[a] = null
			}
		}
	}
	d = e.childNodes;
	if (d) {
		b = d.length;
		for (c = 0; c < b; c += 1) {
			EF.Frontrunner.Activity.Common._purge(e.childNodes[c])
		}
	}
};
EF.Frontrunner.Activity.Common.purge = function(c) {
	if (typeof(c) !== "object") {
		EF.Frontrunner.Activity.Common._purge(c);
		return
	}
	var a = c.length;
	if (a === 0) {
		return
	}
	var b;
	for (b = 0; b < a; b += 1) {
		EF.Frontrunner.Activity.Common._purge(c[b])
	}
};
EF.Frontrunner.Activity.Common.getJTemp_idByPath = function(a) {
	var b = /[^/]+$/.exec(a);
	return b.toString().replace(".", "_")
};
EF.Frontrunner.Activity.Common.loadTemplate = function(f, b, g, a, e) {
	EF.Frontrunner.Activity.Common.purge(f.children());
	var h = true;
	if (EF.Frontrunner.Activity.Common.isDebug) {
		h = false
	}
	$.ajaxSetup({
		cache: h
	});
	if (typeof(isJTempOnPage) !== "undefined" && isJTempOnPage) {
		var c = getJTemp_idByPath(b);
		f.setTemplateElement(c, a, e)
	} else {
		if (typeof(window.siteVersion) === "undefined") {
			window.siteVersion = "development"
		}
		var d = EF.Frontrunner.Activity.Common.getTemplateURL(b);
		f.setTemplateURL(d, a, e)
	}
	f.processTemplate(g)
};
EF.Frontrunner.Activity.Common.loadTemplateToTextForGapFill = function(g, d, e, a, j) {
	var i = "";
	var b = true;
	if (EF.Frontrunner.Activity.Common.isDebug) {
		b = false
	}
	$.ajaxSetup({
		cache: b
	});
	if (/ie 6/i.test(navigator.userAgent)) {
		document.execCommand("BackgroundImageCache", false, true)
	}
	var f;
	if (typeof(isJTempOnPage) !== "undefined" && isJTempOnPage) {
		var h = getJTemp_idByPath(g);
		f = $.createTemplate($("#" + h).html().htmlDecode(), a, j)
	} else {
		if (typeof(window.siteVersion) === "undefined") {
			window.siteVersion = "development"
		}
		var c = EF.Frontrunner.Activity.Common.getTemplateURL(g);
		f = $.createTemplateURL(c, a, j)
	}
	i = $.processTemplateToText(f, d, e);
	return i
};
(function(a) {
	a.placeHolder = {};
	a.removePlaceHolder = {};
	a.fn.extend({
		placeHolder: function(g, f) {
			if (f == undefined || f == "") {
				f = "act_global_placeholder"
			}
			var c = document.createElement("input");
			if ("placeholder" in c) {
				return this.attr("placeholder", g)
			}
			var b = this.selector;
			for (var d = 0; d < this.length; d++) {
				var j = document.createElement("label");
				j.innerHTML = g;
				j.className = f;
				j.id = j.className + d;
				if (this[d].value != "") {
					j.style.display = "none"
				}
				this[d].parentNode.appendChild(j);
				var h = this;
				a(j).bind("click", function() {
					a(this).parent().find(b).focus()
				})
			}
			a(this).bind("focus", function(e) {
				a(this).parent().children("." + f).addClass("act_hide")
			});
			a(this).bind("blur", function() {
				if (this.value == "") {
					a(this).parent().children("." + f).removeClass("act_hide")
				}
			});
			return this
		},
		removePlaceHolder: function(d) {
			if (d == undefined || d == "") {
				d = "act_global_placeholder"
			}
			var b = document.createElement("input");
			if ("placeholder" in b) {
				return this.attr("placeholder", "")
			}
			for (var c = 0; c < this.length; c++) {
				a("." + d).remove()
			}
			return this
		}
	})
})(jQuery);
EF.Frontrunner.Activity.Common.loadJPlayer = function(e, c) {
	var g = {};
	for (var d = 0; d < c.audios.length; d++) {
		var b = c.audios[d];
		g[b.Codec] = b.Url
	}
	var a = "";
	for (var d = 0; d < c.audios.length; d++) {
		a += c.audios[d].Codec + ","
	}
	if (a.length > 0 && a.charAt(a.length - 1) === ",") {
		a = a.substring(0, a.length - 1)
	}
	c.supplied = a;
	c.audios = g;
	c.cssSelectorAncestor = e.selector;
	var f = undefined;
	switch (c.skin) {
	case "normal":
		f = EF.Frontrunner.Activity.ServerConst.jplayer_normal_template_url;
		break;
	case "short":
		f = EF.Frontrunner.Activity.ServerConst.jplayer_normal_template_url;
		break;
	case "mini":
		f = EF.Frontrunner.Activity.ServerConst.jplayer_mini_template_url;
		break;
	default:
		break
	}
	EF.Frontrunner.Activity.Common.loadTemplate(e, f, c.currentIndex, null, {
		filter_data: false
	});
	$(e.selector + " .jp_jplayer").mediaPlayer(c);
	EF.Frontrunner.Activity.Common.Touch.init($(e.selector + " .jp_jplayer")[0])
};
EF.Frontrunner.Activity.Common.loadJPlayer_Video = function(d, b) {
	var h = {};
	for (var c = 0; c < b.videos.length; c++) {
		var a = b.videos[c];
		h[a.Codec] = a.Url
	}
	var e = "";
	for (var c = 0; c < b.videos.length; c++) {
		e += b.videos[c].Codec + ","
	}
	if (e.length > 0 && e.charAt(e.length - 1) === ",") {
		e = e.substring(0, e.length - 1)
	}
	b.supplied = e;
	b.videos = [];
	b.cssSelectorAncestor = d.selector;
	var g = undefined;
	switch (b.skin) {
	case "normal":
		g = EF.Frontrunner.Activity.ServerConst.jplayer_video_normal_template_url;
		break;
	case "short":
		g = EF.Frontrunner.Activity.ServerConst.jplayer_video_normal_template_url;
		break;
	case "mini":
		g = EF.Frontrunner.Activity.ServerConst.jplayer_video_mini_template_url;
		break;
	case "zoomable":
		g = EF.Frontrunner.Activity.ServerConst.jplayer_zoomable_template_url;
		break;
	default:
		break
	}
	EF.Frontrunner.Activity.Common.loadTemplate(d, g, b, null, {
		filter_data: false
	});
	var f = $(d.selector + " .jp_video_jplayer").videoPlayer(b);
	f.jPlayer("setMedia", h);
	return f
};
EF.Frontrunner.Activity.Common.disableElement = function(a, b) {
	a.focus(function() {
		$(this)[0].blur()
	});
	a.attr("readonly", "readonly").addClass(b)
};
EF.Frontrunner.Activity.Common.createjScrollPane = function(a, d) {
	if (d == undefined) {
		d = 54
	}
	var c = $(a).jScrollPane({
		verticalDragMaxHeight: d,
		verticalDragMinHeight: d
	});
	var b = $(a + " .jspVerticalBar").height() - 42;
	$(a + " .jspVerticalBar").css("height", b + "px");
	$(a + " .jspTrack").css("background-position", "-902px " + b + "px")
};
EF.Frontrunner.Activity.Common.getScriptURL = function(a) {
	return EF.Frontrunner.Activity.ServerConst.jsURL + a.substring(0, a.lastIndexOf(".")) + ".min.js?version=" + EF.Frontrunner.Activity.ServerConst.version
};
EF.Frontrunner.Activity.Common.getTemplateURL = function(a) {
	return EF.Frontrunner.Activity.ServerConst.templateURL + a + "?version=" + EF.Frontrunner.Activity.ServerConst.version
};
EF.Frontrunner.Activity.Common.loadScript = function(b, c) {
	if (EF.Frontrunner.Activity.Common.isDebug) {
		if (c) {
			c()
		}
		return
	}
	var a = true;
	$.ajax({
		type: "GET",
		dataType: "script",
		cache: a,
		url: EF.Frontrunner.Activity.Common.getScriptURL(b),
		success: function() {
			if (c) {
				c()
			}
		},
		error: function(e, f, d) {}
	})
};
var count = 0;
EF.Frontrunner.Activity.Common.Clock.Initial = function() {
	EF.Frontrunner.Activity.Common.Clock._currentDateTime = new Date();
	EF.Frontrunner.Activity.Common.Clock._systemDate()
};
EF.Frontrunner.Activity.Common.Clock._systemDate = function() {
	EF.Frontrunner.Activity.Common.Clock._currentDateTime.setSeconds(EF.Frontrunner.Activity.Common.Clock._currentDateTime.getSeconds() + 1);
	setTimeout(EF.Frontrunner.Activity.Common.Clock._systemDate, 1000)
};
EF.Frontrunner.Activity.Common.Clock.getCurrentDate = function() {
	var a, b;
	a = EF.Frontrunner.Activity.Common.Clock._currentDateTime.format("yyyy/MM/dd hh:mm:ss");
	b = new Date(a);
	return b
};
EF.Frontrunner.Activity.Common.changeSecsToMinSecs = function(c) {
	var b, a;
	if (c == null || c < 0) {
		return "00:00"
	}
	b = c / 60 | 0;
	a = parseInt(c) - b * 60;
	if (parseInt(b) < 10) {
		b = "0" + b
	}
	if (a < 10) {
		a = "0" + a
	}
	return b + ":" + a
};
Date.prototype.format = function(b) {
	var c = {
		"M+": this.getMonth() + 1,
		"d+": this.getDate(),
		"h+": this.getHours(),
		"m+": this.getMinutes(),
		"s+": this.getSeconds(),
		"q+": Math.floor((this.getMonth() + 3) / 3),
		S: this.getMilliseconds()
	};
	if (/(y+)/.test(b)) {
		b = b.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length))
	}
	for (var a in c) {
		if (new RegExp("(" + a + ")").test(b)) {
			b = b.replace(RegExp.$1, RegExp.$1.length == 1 ? c[a] : ("00" + c[a]).substr(("" + c[a]).length))
		}
	}
	return b
};
Date.prototype.getDiff = function(b, c) {
	if (!(b instanceof Date)) {
		return -1
	}
	var a;
	switch (c) {
	case "s":
		a = (this.getTime() - b.getTime()) / 1000;
		break;
	case "m":
		a = (this.getTime() - b.getTime()) / 60000;
		break;
	case "h":
		a = (this.getTime() - b.getTime()) / 3600000;
		break;
	case "d":
		a = (this.getTime() - b.getTime()) / 86400000
	}
	return Math.floor(a)
};
EF.Frontrunner.Activity.Common.uploadDataToServer = function(a) {
	EF.Frontrunner.ActivityManager.Interface.submitActivity(a)
};
EF.Frontrunner.Activity.Common.cloneJSON = function(b) {
	var a = JSON.stringify(b);
	return JSON.parse(a)
};
EF.Frontrunner.Activity.Common.showPopupWindow = function(b, a, d, h) {
	var m = $("#act_mask");
	var e = $("#act_popup");
	if (m.length > 0 && e.length > 0) {
		return
	}
	function g(i, o) {
		var n = document.createElement(i);
		n.id = o;
		document.body.appendChild(n);
		return $("#" + o)
	}
	if (m.length == 0) {
		m = g("div", "act_mask")
	}
	var f = function() {
			m.css("height", document.documentElement.scrollHeight).css("width", document.documentElement.scrollWidth)
		};
	f();
	m.removeClass("act_hide");
	if (e.length == 0) {
		e = g("div", "act_popup")
	}
	e.addClass("act_hide").addClass(b);
	EF.Frontrunner.Activity.Common.loadTemplate(e, a, d, null, {
		filter_data: false
	});
	for (var c = 0; c < d.Buttons.length; c++) {
		var j = d.Buttons[c];
		var l = j.callback;
		if (l) {
			$("#act_popup_btn" + j.id).bind("click", function() {
				l()
			})
		}
	}
	$(".act_popup_btn").bind("click", function() {
		m.addClass("act_hide");
		$(window).unbind("resize");
		e.remove()
	});
	$("#act_popup_btnyes").bind("click", function() {
		if (h) {
			h()
		}
	});
	var k = function() {
			if (EF.Frontrunner.Activity.Common.Touch.isiPad()) {
				e.css("top", document.body.clientHeight - e.height() * 3).css("left", document.documentElement.clientWidth / 2 - e.width() / 2)
			} else {
				e.css("top", (document.documentElement.clientHeight || document.body.clientHeight) / 2 - e.height() / 2).css("left", document.documentElement.clientWidth / 2 - e.width() / 2)
			}
		};
	k();
	e.removeClass("act_hide");
	$(window).bind("resize", function() {
		if ($("#act_mask").length > 0) {
			f()
		}
		if ($("#act_popup").length > 0) {
			k()
		}
	})
};
!
function(d) {
	var b = d.navigator.userAgent.toLowerCase(),
		c = /msie|applewebkit.+safari/;
	if (c.test(b)) {
		var a = Array.prototype.sort;
		Array.prototype.sort = function(m) {
			if ( !! m && typeof m === "function") {
				if (this.length < 2) {
					return this
				}
				var k = 0,
					f = k + 1,
					e = this.length,
					h, n = false,
					g = 0;
				for (; k < e; k++) {
					for (f = k + 1; f < e; f++) {
						g = m.call(this, this[k], this[f]);
						n = (typeof g === "number" ? g : !! g ? 1 : 0) > 0 ? true : false;
						if (n) {
							h = this[k];
							this[k] = this[f];
							this[f] = h
						}
					}
				}
				return this
			} else {
				return a.call(this)
			}
		}
	}
}(window);
EF.Frontrunner.Activity.Common.Clock.Initial();
EF.Frontrunner.Activity.Common.Touch = EF.Frontrunner.Activity.Common.Touch || {};
EF.Frontrunner.Activity.Common.Touch.isiPad = function() {
	return navigator.userAgent.match(/iPad/i) !== null
};
EF.Frontrunner.Activity.Common.Touch.touchHandler = function(e) {
	var c = e.changedTouches;
	var b = c[0];
	if (e.touches.length > 1) {
		return false
	}
	var a = "";
	var d = document.createEvent("MouseEvent");
	switch (e.type) {
	case "touchstart":
		a = "mousedown";
		break;
	case "touchmove":
		a = "mousemove";
		e.preventDefault();
		break;
	case "touchend":
		a = "mouseup";
		break;
	default:
		return
	}
	d.initMouseEvent(a, true, true, window, 1, b.screenX, b.screenY, b.clientX, b.clientY, false, false, false, false, 0, null);
	b.target.dispatchEvent(d)
};
EF.Frontrunner.Activity.Common.Touch.init = function(a) {
	if (!a) {
		a = document
	}
	if (EF.Frontrunner.Activity.Common.Touch.isiPad()) {
		a.addEventListener("touchstart", EF.Frontrunner.Activity.Common.Touch.touchHandler, false);
		a.addEventListener("touchend", EF.Frontrunner.Activity.Common.Touch.touchHandler, false);
		a.addEventListener("touchmove", EF.Frontrunner.Activity.Common.Touch.touchHandler, false);
		a.addEventListener("touchcancel", EF.Frontrunner.Activity.Common.Touch.touchHandler, false);
		a.addEventListener("touchdown", EF.Frontrunner.Activity.Common.Touch.touchHandler, false);
		a.addEventListener("touchup", EF.Frontrunner.Activity.Common.Touch.touchHandler, false)
	}
};
EF.Frontrunner.Activity.Const = EF.Frontrunner.Activity.Const || {};
EF.Frontrunner.Activity.Const = {
	submit: "SUBMIT",
	resubmit: "RESUBMIT",
	next: "NEXT",
	help: "Help",
	check: "CHECK",
	myAnswer: "MY ANSWER",
	correctAnswer: "CORRECT ANSWER",
	waiting: "Saving...",
	entertext: "Enter text here...",
	popupmessage: "You haven’t answered all the questions. Click ‘Submit’ again to continue.",
	resubmitpopupmessage: "Your answers are not saved successfully. Click 'RESUBMIT' and try again.",
	havingtrouble: "Having trouble?",
	havingtroubleContent: "Contact your teacher for more help.",
	goodeffort: "Good effort.",
	goodeffortContent: "Try again after some more practice.",
	passed: "You passed.",
	passedContent: "Try the next activity.",
	welldone: "Well done!",
	welldoneContent: "Go on to the next activity.",
	perfect: "Perfect!",
	perfectContent: "Go on to the next activity.",
	goodtry: "Good try.",
	goodtryContent: "Come back after some more practice.",
	gettingthere: "Getting there.",
	gettingthereContent: "Try again to get them all correct.",
	welldonetry: "Well done. That’s all of them!",
	welldonetryContent: "Go on to the next activity.",
	checkyourwork: "CHECK YOUR WORK",
	checkmessage: "Your answers will be sent to your teacher.",
	checkinfo: "Are you sure you want to continue?",
	popupwindow_yes: "Yes",
	popupwindow_no: "No",
	resultmessage: "Your work has been sent to your teacher.",
	timeremain: "Time count down:",
	close: "Close",
	timeouttitle: "Frontrunner Assessment",
	timeoutcontent: "<p>There is no time avilable to complete the remaining questions.The questions you have answered will be marked and your teacher will contact you with your test score.</p><p>Close this window to go back and choose new activities to work on.</p>",
	spaw_notenough: "You haven't written enough yet.",
	spaw_wordcount: "Word Count:",
	spaw_defaultwordcount: "0",
	spaw_suggestedwordcount: "Minimum Word Count: ",
	spaw_defaultsuggestedwordcount: "150",
	spaw_checktitle: "Check your work",
	spaw_checktips: "Use the list below to check your work again before sending it to your teacher.",
	rasa_popupmessage: "You haven't answered all the questions yet.",
	raw_popupmessage: "You haven't written enough yet.",
	raw_wordcount: "Word Count:",
	raw_defaultwordcount: "0",
	raw_suggestedwordcount: "Minimum Word Count: ",
	raw_defaultsuggestedwordcount: "150",
	raw_checktitle: "Check your work",
	raw_checktips: "Use the list below to check your work again before sending it to your teacher.",
	gf_inputmaxlen: "25",
	gf_title_myans: "My answer",
	gf_title_corans: "Correct answer",
	lgf_inputmaxlen: "25",
	lgf_title_myans: "My answer",
	lgf_title_corans: "Correct answer",
	rahl_title_myans: "My answer",
	rahl_title_corans: "Correct answer",
	ramc_title_myans: "My answer",
	ramc_title_corrans: "Correct answer",
	mc_title_myans: "My answer",
	mc_title_corrans: "Correct answer",
	mttiwa_title_myans: "My answer",
	mttiwa_title_corrans: "Correct answer",
	lam_title_myans: "My answer",
	lam_title_corrans: "Correct answer",
	lasa_popupmessage: 'Are you sure?You haven\'t answered all the questions.Click to "<b>submit to teacher</b>" anyway.',
	lasa_title_myans: "My answer",
	lacc_title_myans: "My answer",
	lacc_title_corrans: "Correct answer",
	cz_title_myans: "My answer",
	cz_title_corrans: "Correct answer",
	us_title_myans: "My answer",
	us_title_corrans: "Correct answer",
	us_popupmessage: 'Are you sure?You haven\'t answered all the questions.Click to "<b>submit</b>" anyway.',
	fc_title_myans: "My answer",
	fc_title_corrans: "Correct answer",
	fc_flip_text: "Flip all cards",
	seq_title_myans: "My answer",
	seq_title_corrans: "Correct answer",
};
EF.Frontrunner.Activity.ServerConst = EF.Frontrunner.Activity.ServerConst || {};
EF.Frontrunner.Activity.ServerConst = {
	raw_template_url: "readandwrite.tpl",
	rasa_template_url: "readandshortanswer.tpl",
	gf_template_url: "gapfill.tpl",
	gf_template_input_url: "gapfill_input.tpl",
	lgf_template_url: "listenandgapfill.tpl",
	lgf_template_input_url: "listenandgapfill_input.tpl",
	rahl_template_url: "readandhighlight.tpl",
	mt_template_url: "matching.tpl",
	spaw_template_url: "seepictureandwrite.tpl",
	ramc_template_url: "readandmultiplechoice.tpl",
	mc_template_url: "multiplechoice.tpl",
	lasa_template_url: "listenandshortanswer.tpl",
	jplayer_normal_template_url: "jplayer_normal.tpl",
	jplayer_mini_template_url: "jplayer_mini.tpl",
	jplayer_zoomable_template_url: "jplayer_zoomable.tpl",
	lac_template_url: "listenandchoose.tpl",
	mttiwa_template_url: "matchingtexttoimagewithaudio.tpl",
	lam_template_url: "listenandmatch.tpl",
	lacc_template_url: "listenandcompletechart.tpl",
	cz_template_url: "categorization.tpl",
	presentation_template_url: "presentation.tpl",
	sequence_template_url: "sequence.tpl",
	writing_framework_url: "writing_layout.tpl",
	standard_framework_url: "standard_layout.tpl",
	assessment_framework_url: "assessment_layout.tpl",
	writing_popup_url: "writing_popup.tpl",
	assessment_popup_url: "assessment_popup.tpl",
	presentation_framework_url: "presentation_layout.tpl",
	jplayer_video_normal_template_url: "jplayer_video.tpl",
	us_template_url: "unscrumb.tpl",
	fc_template_url: "flashcard.tpl",
	vama_template_url: "videoandmultipleanswer.tpl",
	spawwa_template_url: "seepictureandwritewithaudio.tpl",
	rawwa_template_url: "readandwritewithaudio.tpl",
};
EF.Frontrunner.Activity.ServerConst.templateURL = "_templates/";
EF.Frontrunner.Activity.ServerConst.jsURL = "_scripts/";
EF.Frontrunner.Activity.ServerConst.activityResourceURL = "";
EF.Frontrunner.Activity.ServerConst.version = "1.0";
EF.Frontrunner.Activity.ServerConst.minScore = 70;
EF.Frontrunner.Activity.ServerConst.assessmentTotalPoint = 15;
EF.Frontrunner.Activity.Framework.Standard = {
	events: {},
	handlers: {},
	behaviors: {},
	models: {}
};
EF.Frontrunner.Activity.Framework.Standard.models = {
	startTime: undefined,
	endTime: undefined,
	timeElapsed: undefined,
	_startTime: undefined,
	_endTime: undefined
};
EF.Frontrunner.Activity.Framework.Standard.initial = function(b, d) {
	var c = $("#activity");
	var a = EF.Frontrunner.Activity.ServerConst.standard_framework_url;
	EF.Frontrunner.Activity.Common.loadTemplate(c, a, b, null, {
		filter_data: false
	});
	if (d != null) {
		d()
	}
	EF.Frontrunner.Activity.Framework.Standard._register();
	EF.Frontrunner.Activity.Framework.Standard._initTextAndCss();
	EF.Frontrunner.Activity.Framework.Standard.models._startTime = EF.Frontrunner.Activity.Common.Clock.getCurrentDate();
	EF.Frontrunner.Activity.Framework.Standard.models.startTime = EF.Frontrunner.Activity.Framework.Standard.models._startTime.format("yyyy-MM-dd hh:mm:ss")
};
EF.Frontrunner.Activity.Framework.Standard._submit = function() {
	EF.Frontrunner.Activity.Framework.Standard.models._endTime = EF.Frontrunner.Activity.Common.Clock.getCurrentDate();
	EF.Frontrunner.Activity.Framework.Standard.models.endTime = EF.Frontrunner.Activity.Framework.Standard.models._endTime.format("yyyy-MM-dd hh:mm:ss");
	var a = EF.Frontrunner.Activity.Framework.Standard.models._endTime.getDiff(EF.Frontrunner.Activity.Framework.Standard.models._startTime, "s");
	EF.Frontrunner.Activity.Framework.Standard.models.timeElapsed = a;
	if (!(EF.Frontrunner.Activity.ProcessManager.currentActivity.canSubmit == undefined)) {
		if (!EF.Frontrunner.Activity.ProcessManager.currentActivity.canSubmit()) {
			if (EF.Frontrunner.Activity.Framework.Standard._showPopup()) {
				return
			}
		}
	}
	$("#act_btn_submit").unbind();
	EF.Frontrunner.Activity.Framework.Standard._submitAnimate(EF.Frontrunner.Activity.ProcessManager.submit)
};
EF.Frontrunner.Activity.Framework.Standard._submitAnimate = function(a) {
	$("#act_btn_submit").fadeOut(500, function() {
		if (a != null) {
			a()
		}
		$("#act_btn_submit span").html(EF.Frontrunner.Activity.Const.waiting);
		$("#act_btn_submit").show();
		$("#act_submitted").removeClass("act_hide");
		$("#act_submitted").hide();
		setTimeout(function() {
			$("#act_btn_key").css("margin-right", "200px");
			$("#act_btn_key").removeClass("act_hide");
			$("#act_btn_key").animate({
				"margin-right": "15px"
			}, 500)
		}, 300);
		setTimeout(function() {
			$("#act_btn_check").css("margin-right", "150px");
			$("#act_btn_check").removeClass("act_hide");
			$("#act_btn_check").animate({
				"margin-right": "15px"
			}, 500, function() {
				$("#act_submitted").fadeIn()
			})
		}, 500)
	})
};
EF.Frontrunner.Activity.Framework.Standard.showScoreAndMessage = function(a, b, g, f, e) {
	var c, d;
	if (a === "Submit") {
		$("#act_span_correct").text(b);
		$("#act_span_total").text(g);
		if (f < 10) {
			c = EF.Frontrunner.Activity.Const.havingtrouble;
			d = EF.Frontrunner.Activity.Const.havingtroubleContent
		} else {
			if (f < 60) {
				c = EF.Frontrunner.Activity.Const.goodeffort;
				d = EF.Frontrunner.Activity.Const.goodeffortContent
			} else {
				if (f < 80) {
					c = EF.Frontrunner.Activity.Const.passed;
					d = EF.Frontrunner.Activity.Const.passedContent
				} else {
					if (f < 100) {
						c = EF.Frontrunner.Activity.Const.welldone;
						d = EF.Frontrunner.Activity.Const.welldoneContent
					} else {
						c = EF.Frontrunner.Activity.Const.perfect;
						d = EF.Frontrunner.Activity.Const.perfectContent
					}
				}
			}
		}
	} else {
		if (e <= f) {
			c = $("#act_fk_title").text();
			d = $("#act_fk_content").text()
		} else {
			if (e == 100) {
				c = EF.Frontrunner.Activity.Const.welldonetry;
				d = EF.Frontrunner.Activity.Const.welldonetryContent
			} else {
				if (e > f) {
					c = EF.Frontrunner.Activity.Const.gettingthere;
					d = EF.Frontrunner.Activity.Const.gettingthereContent
				}
			}
		}
	}
	$("#act_fk_title").text(c);
	$("#act_fk_content").text(d)
};
EF.Frontrunner.Activity.Framework.Standard._showPopup = function(a) {
	if ($("#act_submit_popup").hasClass("act_hide")) {
		$("#act_submit_popup").removeClass("act_hide");
		return true
	} else {
		$("#act_submit_popup").addClass("act_hide");
		return false
	}
};
EF.Frontrunner.Activity.Framework.Standard._register = function() {
	EF.Frontrunner.Activity.Framework.Standard.events._registerControlBarButtonClick();
	EF.Frontrunner.Activity.Framework.Standard.events._registerControlBarButtonHover();
	EF.Frontrunner.Activity.Framework.Standard.events._registerControlBarButtonMouse();
	if (!EF.Frontrunner.Activity.Common.Touch.isiPad()) {
		EF.Frontrunner.Activity.Framework.Standard.events._registerBodyClickAfterPopup()
	} else {
		EF.Frontrunner.Activity.Framework.Standard.events._registerBodyTouchAfterPopup()
	}
};
EF.Frontrunner.Activity.Framework.Standard._initTextAndCss = function() {
	$("#act_title_help span a").text(EF.Frontrunner.Activity.Const.help);
	$("#act_btn_submit span").text(EF.Frontrunner.Activity.Const.submit);
	$("#act_btn_check span").text(EF.Frontrunner.Activity.Const.check);
	$("#act_btn_next span").text(EF.Frontrunner.Activity.Const.next);
	$("#act_btn_key span.act_btn_key_left").text(EF.Frontrunner.Activity.Const.correctAnswer);
	$("#act_waiting").text(EF.Frontrunner.Activity.Const.waiting);
	$("#act_submit_popup span").text(EF.Frontrunner.Activity.Const.popupmessage);
	$("#act_resubmit_popup span").text(EF.Frontrunner.Activity.Const.resubmitpopupmessage)
};
EF.Frontrunner.Activity.Framework.Standard.events._registerControlBarButtonClick = function() {
	if (EF.Frontrunner.Activity.Common.Touch.isiPad()) {
		$("#act_btn_submit").bind("touchstart", function(a) {
			a.cancelBubble = true;
			a.stopPropagation();
			a.preventDefault();
			EF.Frontrunner.Activity.Framework.Standard._submit();
			return false
		})
	} else {
		$("#act_btn_submit").bind("mousedown", function(a) {
			a.cancelBubble = true;
			a.stopPropagation();
			a.preventDefault()
		});
		$("#act_btn_submit").bind("click", function(a) {
			a.cancelBubble = true;
			a.stopPropagation();
			a.preventDefault();
			EF.Frontrunner.Activity.Framework.Standard._submit();
			return false
		})
	}
	$("#act_btn_next").click(function(b) {
		var a = "2";
		EF.Frontrunner.Activity.ProcessManager.next(a)
	});
	$("#act_btn_key").click(function(b) {
		var a = "";
		b.cancelBubble = true;
		b.stopPropagation();
		b.preventDefault();
		$("#act_btn_check").addClass("act_hide");
		EF.Frontrunner.Activity.ProcessManager.key(a);
		if (!$(this).hasClass("act_btn_key_correct")) {
			$("#act_btn_key span.act_btn_key_left").text(EF.Frontrunner.Activity.Const.correctAnswer)
		} else {
			$("#act_btn_key span.act_btn_key_left").text(EF.Frontrunner.Activity.Const.myAnswer)
		}
	});
	$("#act_btn_check").click(function(b) {
		if ($(this).hasClass("act_btn_check_inactive")) {
			return
		}
		var a = "";
		b.cancelBubble = true;
		b.stopPropagation();
		b.preventDefault();
		EF.Frontrunner.Activity.ProcessManager.check(a)
	})
};
EF.Frontrunner.Activity.Framework.Standard.events._registerControlBarButtonHover = function() {
	$("#act_btn_submit").hover(function() {
		$(this).removeClass("act_btn_submitnext_active");
		$(this).addClass("act_btn_submitnext_hover")
	}, function() {
		$(this).removeClass("act_btn_submitnext_hover");
		$(this).addClass("act_btn_submitnext_active")
	});
	$("#act_btn_next").hover(function() {
		$(this).removeClass("act_btn_submitnext_active");
		$(this).addClass("act_btn_submitnext_hover")
	}, function() {
		$(this).removeClass("act_btn_submitnext_hover");
		$(this).addClass("act_btn_submitnext_active")
	});
	$("#act_btn_key").hover(function() {
		$(this).removeClass("act_btn_key_active");
		$(this).addClass("act_btn_key_hover")
	}, function() {
		$(this).removeClass("act_btn_key_hover");
		$(this).addClass("act_btn_key_active")
	});
	$("#act_btn_check").hover(function() {
		if (!$(this).hasClass("act_btn_check_inactive")) {
			$(this).removeClass("act_btn_check_active");
			$(this).addClass("act_btn_check_hover")
		}
	}, function() {
		if (!$(this).hasClass("act_btn_check_inactive")) {
			$(this).removeClass("act_btn_check_hover");
			$(this).addClass("act_btn_check_active")
		}
	})
};
EF.Frontrunner.Activity.Framework.Standard.events._registerControlBarButtonMouse = function() {
	$("#act_btn_submit").mousedown(function(a) {
		$(this).removeClass("act_btn_submitnext_hover");
		$(this).addClass("act_btn_submitnext_clicked")
	});
	$("#act_btn_submit").mouseup(function(a) {
		$(this).removeClass("act_btn_submitnext_clicked");
		$(this).addClass("act_btn_submitnext_hover")
	});
	$("#act_btn_next").mousedown(function(a) {
		$(this).removeClass("act_btn_submitnext_hover");
		$(this).addClass("act_btn_submitnext_clicked")
	});
	$("#act_btn_next").mouseup(function(a) {
		$(this).removeClass("act_btn_submitnext_clicked");
		$(this).addClass("act_btn_submitnext_hover")
	});
	$("#act_btn_check").mousedown(function(a) {
		if (!$(this).hasClass("act_btn_check_inactive")) {
			$(this).removeClass("act_btn_check_hover");
			$(this).addClass("act_btn_check_clicked")
		}
	});
	$("#act_btn_check").mouseup(function(a) {
		if (!$(this).hasClass("act_btn_check_inactive")) {
			$(this).removeClass("act_btn_check_clicked");
			$(this).addClass("act_btn_check_hover")
		}
	});
	$("#act_btn_key").mousedown(function(a) {
		if (!$(this).hasClass("act_btn_key_inactive")) {
			$(this).removeClass("act_btn_key_hover");
			$(this).addClass("act_btn_key_clicked")
		}
	});
	$("#act_btn_key").mouseup(function(a) {
		if (!$(this).hasClass("act_btn_key_inactive")) {
			$(this).removeClass("act_btn_key_clicked");
			$(this).addClass("act_btn_key_hover")
		}
	})
};
EF.Frontrunner.Activity.Framework.Standard.events._registerBodyClickAfterPopup = function() {
	$("body").unbind("click mousedown");
	$("body").bind("click mousedown", function() {
		if (!$("#act_submit_popup").hasClass("act_hide")) {
			$("#act_submit_popup").addClass("act_hide")
		}
	})
};
EF.Frontrunner.Activity.Framework.Standard.events._registerBodyTouchAfterPopup = function() {
	$("body").unbind("touchstart");
	$("body").bind("touchstart", function() {
		if (!$("#act_submit_popup").hasClass("act_hide")) {
			$("#act_submit_popup").addClass("act_hide")
		}
	})
};
EF.Frontrunner.Activity.Framework.Writing = {
	models: {},
	events: {},
	handlers: {},
	behaviors: {}
};
EF.Frontrunner.Activity.Framework.Writing.models = {
	startTime: undefined,
	endTime: undefined,
	timeElapsed: undefined,
	_startTime: undefined,
	_endTime: undefined
};
EF.Frontrunner.Activity.Framework.Writing.initial = function(b, d) {
	var c = $("#activity");
	var a = EF.Frontrunner.Activity.ServerConst.writing_framework_url;
	EF.Frontrunner.Activity.Common.loadTemplate(c, a, b, null, {
		filter_data: false
	});
	if (d != null) {
		d()
	}
	EF.Frontrunner.Activity.Framework.Writing._register();
	EF.Frontrunner.Activity.Framework.Writing._initTextAndCss();
	EF.Frontrunner.Activity.Framework.Writing.models._startTime = EF.Frontrunner.Activity.Common.Clock.getCurrentDate();
	EF.Frontrunner.Activity.Framework.Writing.models.startTime = EF.Frontrunner.Activity.Framework.Writing.models._startTime.format("yyyy-MM-dd hh:mm:ss")
};
EF.Frontrunner.Activity.Framework.Writing.showScoreAndMessage = function(a, b, e, d, c) {
	return
};
EF.Frontrunner.Activity.Framework.Writing._submit = function() {
	EF.Frontrunner.Activity.Framework.Writing.models._endTime = EF.Frontrunner.Activity.Common.Clock.getCurrentDate();
	EF.Frontrunner.Activity.Framework.Writing.models.endTime = EF.Frontrunner.Activity.Framework.Writing.models._endTime.format("yyyy-MM-dd hh:mm:ss");
	var a = EF.Frontrunner.Activity.Framework.Writing.models._endTime.getDiff(EF.Frontrunner.Activity.Framework.Writing.models._startTime, "s");
	EF.Frontrunner.Activity.Framework.Writing.models.timeElapsed = a;
	if (!(EF.Frontrunner.Activity.ProcessManager.currentActivity.canSubmit == undefined)) {
		if (!EF.Frontrunner.Activity.ProcessManager.currentActivity.canSubmit()) {
			EF.Frontrunner.Activity.Framework.Writing._showPopup();
			return
		} else {
			if (!$("#act_submit_popup").hasClass("act_hide")) {
				$("#act_submit_popup").addClass("act_hide")
			}
			EF.Frontrunner.Activity.Framework.Writing._showPopupWindow(function() {
				$("#act_btn_submit").unbind();
				EF.Frontrunner.Activity.Framework.Writing._submitAnimate(EF.Frontrunner.Activity.ProcessManager.submit)
			})
		}
	}
};
EF.Frontrunner.Activity.Framework.Writing._submitAnimate = function(a) {
	$("#act_btn_submit").fadeOut(500, function() {
		$("#act_btn_check").addClass("act_hide");
		$("#act_btn_submit span").html(EF.Frontrunner.Activity.Const.waiting);
		$("#act_btn_submit").show();
		if (a != null) {
			a()
		}
		if (!$("#act_waiting").hasClass("act_hide")) {
			$("#act_waiting").addClass("act_hide")
		}
		$("#act_submitted").fadeIn(500, function() {
			$("#act_submitted").removeClass("act_hide")
		})
	})
};
EF.Frontrunner.Activity.Framework.Writing._showPopup = function(a) {
	if ($("#act_submit_popup").hasClass("act_hide")) {
		$("#act_submit_popup").removeClass("act_hide")
	}
};
EF.Frontrunner.Activity.Framework.Writing._showPopupWindow = function(d) {
	var b = {};
	b.Buttons = [{
		id: "yes",
		className: "yes",
		text: EF.Frontrunner.Activity.Const.popupwindow_yes,
		callback: ""
	}, {
		id: "no",
		className: "no",
		text: EF.Frontrunner.Activity.Const.popupwindow_no,
		callback: ""
	}];
	b.message = EF.Frontrunner.Activity.Const.checkmessage;
	b.info = EF.Frontrunner.Activity.Const.checkinfo;
	var c = "act_writing_popup";
	var a = EF.Frontrunner.Activity.ServerConst.writing_popup_url;
	EF.Frontrunner.Activity.Common.showPopupWindow(c, a, b, d)
};
EF.Frontrunner.Activity.Framework.Writing._register = function() {
	EF.Frontrunner.Activity.Framework.Writing.events._registerControlBarButtonClick();
	EF.Frontrunner.Activity.Framework.Writing.events._registerControlBarButtonHover();
	EF.Frontrunner.Activity.Framework.Writing.events._registerControlBarButtonMouse();
	EF.Frontrunner.Activity.Framework.Writing.events._registerBodyClickAfterPopup()
};
EF.Frontrunner.Activity.Framework.Writing._initTextAndCss = function() {
	$("#act_title_help span a").text(EF.Frontrunner.Activity.Const.help);
	$("#act_btn_submit span").text(EF.Frontrunner.Activity.Const.submit);
	$("#act_btn_check span").text(EF.Frontrunner.Activity.Const.checkyourwork);
	$("#act_btn_next span").text(EF.Frontrunner.Activity.Const.next);
	$("#act_waiting").text(EF.Frontrunner.Activity.Const.waiting);
	$("#act_fk_content").text(EF.Frontrunner.Activity.Const.resultmessage);
	$("#act_resubmit_popup span").text(EF.Frontrunner.Activity.Const.resubmitpopupmessage)
};
EF.Frontrunner.Activity.Framework.Writing.events._registerControlBarButtonClick = function() {
	$("#act_btn_submit").click(function(a) {
		a.cancelBubble = true;
		a.stopPropagation();
		a.preventDefault();
		EF.Frontrunner.Activity.Framework.Writing._submit()
	});
	$("#act_btn_next").click(function(b) {
		var a = "2";
		EF.Frontrunner.Activity.ProcessManager.next(a)
	});
	$("#act_btn_check").click(function(b) {
		if ($(this).hasClass("act_btn_check_inactive")) {
			return
		}
		var a = "";
		b.cancelBubble = true;
		b.stopPropagation();
		b.preventDefault();
		EF.Frontrunner.Activity.ProcessManager.check(a)
	})
};
EF.Frontrunner.Activity.Framework.Writing.events._registerControlBarButtonHover = function() {
	$("#act_btn_submit").hover(function() {
		$(this).removeClass("act_btn_submitnext_active").addClass("act_btn_submitnext_hover");
		if (EF.Frontrunner.Activity.ProcessManager.currentActivity.canSubmit) {
			var a = EF.Frontrunner.Activity.ProcessManager.currentActivity.canSubmit();
			if (a) {
				$("#act_btn_submit").mousedown(function(b) {
					$(this).removeClass("act_btn_submitnext_hover").addClass("act_btn_submitnext_clicked")
				})
			} else {
				if ($("#act_submit_popup").hasClass("act_hide")) {
					$("#act_submit_popup").removeClass("act_hide")
				}
				$("#act_btn_submit").unbind("mousedown")
			}
		}
	}, function() {
		$(this).removeClass("act_btn_submitnext_hover").addClass("act_btn_submitnext_active");
		if (!$("#act_submit_popup").hasClass("act_hide")) {
			$("#act_submit_popup").addClass("act_hide")
		}
	});
	$("#act_btn_next").hover(function() {
		$(this).removeClass("act_btn_submitnext_active").addClass("act_btn_submitnext_hover")
	}, function() {
		$(this).removeClass("act_btn_submitnext_hover").addClass("act_btn_submitnext_active")
	});
	$("#act_btn_check").hover(function() {
		if (!$(this).hasClass("act_btn_check_inactive")) {
			$(this).removeClass("act_btn_check_active").addClass("act_btn_check_hover")
		}
	}, function() {
		if (!$(this).hasClass("act_btn_check_inactive")) {
			$(this).removeClass("act_btn_check_hover").addClass("act_btn_check_active")
		}
	})
};
EF.Frontrunner.Activity.Framework.Writing.events._registerControlBarButtonMouse = function() {
	$("#act_btn_submit").mousedown(function(a) {
		$(this).removeClass("act_btn_submitnext_hover").addClass("act_btn_submitnext_clicked")
	});
	$("#act_btn_submit").mouseup(function(a) {
		$(this).removeClass("act_btn_submitnext_clicked").addClass("act_btn_submitnext_hover")
	});
	$("#act_btn_next").mousedown(function(a) {
		$(this).removeClass("act_btn_submitnext_hover").addClass("act_btn_submitnext_clicked")
	});
	$("#act_btn_next").mouseup(function(a) {
		$(this).removeClass("act_btn_submitnext_clicked").addClass("act_btn_submitnext_hover")
	});
	$("#act_btn_check").mousedown(function(a) {
		if (!$(this).hasClass("act_btn_check_inactive")) {
			$(this).removeClass("act_btn_check_hover").addClass("act_btn_check_clicked")
		}
	});
	$("#act_btn_check").mouseup(function(a) {
		if (!$(this).hasClass("act_btn_check_inactive")) {
			$(this).removeClass("act_btn_check_clicked").addClass("act_btn_check_hover")
		}
	})
};
EF.Frontrunner.Activity.Framework.Writing.events._registerBodyClickAfterPopup = function() {
	$("body").bind("touchstart", function() {
		if (!$("#act_submit_popup").hasClass("act_hide")) {
			$("#act_submit_popup").addClass("act_hide")
		}
	})
};
EF.Frontrunner.Activity.Framework.Assessment = {
	models: {},
	events: {},
	handlers: {},
	behaviors: {}
};
EF.Frontrunner.Activity.Framework.Assessment.models = {
	startTime: undefined,
	endTime: undefined,
	timeElapsed: undefined,
	timerID: undefined,
	_startTime: undefined,
	_endTime: undefined,
	_timeRemain: undefined
};
EF.Frontrunner.Activity.Framework.Assessment.initial = function(b, d) {
	var c = $("#activity");
	var a = EF.Frontrunner.Activity.ServerConst.assessment_framework_url;
	EF.Frontrunner.Activity.Common.loadTemplate(c, a, b, null, {
		filter_data: false
	});
	if (d != null) {
		d()
	}
	if (EF.Frontrunner.Activity.Framework.Assessment.models.timerID != undefined) {
		clearInterval(EF.Frontrunner.Activity.Framework.Assessment.models.timerID)
	}
	EF.Frontrunner.Activity.Framework.Assessment._register();
	EF.Frontrunner.Activity.Framework.Assessment._initTextAndCss();
	EF.Frontrunner.Activity.Framework.Assessment._setTimeRemain(b.Common.AvailableTime);
	EF.Frontrunner.Activity.Framework.Assessment._timeRemain = b.Common.AvailableTime;
	EF.Frontrunner.Activity.Framework.Assessment.models.timerID = EF.Frontrunner.Activity.Framework.Assessment._countTimer();
	EF.Frontrunner.Activity.Framework.Assessment.models._startTime = EF.Frontrunner.Activity.Common.Clock.getCurrentDate();
	EF.Frontrunner.Activity.Framework.Assessment.models.startTime = EF.Frontrunner.Activity.Framework.Assessment.models._startTime.format("yyyy-MM-dd hh:mm:ss")
};
EF.Frontrunner.Activity.Framework.Assessment.showScoreAndMessage = function(a, b, e, d, c) {
	$(".act_rahl_word_correct").removeClass("act_rahl_word_correct");
	$(".act_rahl_word_incorrect").removeClass("act_rahl_word_incorrect");
	$(".act_lac_opt_default").removeClass("act_lac_opt_incorrect").removeClass("act_lac_opt_correct");
	$(".act_ramc_opt_default").removeClass("act_ramc_opt_correct").removeClass("act_ramc_opt_incorrect");
	$(".act_mc_opt_default").removeClass("act_mc_opt_incorrect").removeClass("act_mc_opt_correct");
	$(".act_cz_question").addClass(" act_cz_question_draginactive");
	$(".act_feedback_icon").hide();
	return
};
EF.Frontrunner.Activity.Framework.Assessment._submit = function() {
	$(".act_feedback_icon").hide();
	EF.Frontrunner.Activity.Framework.Assessment.models._endTime = EF.Frontrunner.Activity.Common.Clock.getCurrentDate();
	EF.Frontrunner.Activity.Framework.Assessment.models.endTime = EF.Frontrunner.Activity.Framework.Assessment.models._endTime.format("yyyy-MM-dd hh:mm:ss");
	var a = EF.Frontrunner.Activity.Framework.Assessment.models._endTime.getDiff(EF.Frontrunner.Activity.Framework.Assessment.models._startTime, "s");
	EF.Frontrunner.Activity.Framework.Assessment.models.timeElapsed = a;
	if (!(EF.Frontrunner.Activity.ProcessManager.currentActivity.canSubmit == undefined)) {
		if (!EF.Frontrunner.Activity.ProcessManager.currentActivity.canSubmit()) {
			if (EF.Frontrunner.Activity.Framework.Assessment._showPopup()) {
				return
			}
		}
	}
	$("#act_btn_submit").unbind();
	if (EF.Frontrunner.Activity.Framework.Assessment.models.timerID != undefined) {
		clearInterval(EF.Frontrunner.Activity.Framework.Assessment.models.timerID)
	}
	EF.Frontrunner.Activity.Framework.Assessment._submitAnimate(EF.Frontrunner.Activity.ProcessManager.submit)
};
EF.Frontrunner.Activity.Framework.Assessment._submitAnimate = function(a) {
	if (a != null) {
		a()
	}
	$("#act_btn_submit span").html(EF.Frontrunner.Activity.Const.waiting);
	$("#act_btn_submit").show()
};
EF.Frontrunner.Activity.Framework.Assessment._showPopup = function(a) {
	if ($("#act_submit_popup").hasClass("act_hide")) {
		$("#act_submit_popup").removeClass("act_hide");
		return true
	} else {
		$("#act_submit_popup").addClass("act_hide");
		return false
	}
};
EF.Frontrunner.Activity.Framework.Assessment._countTimer = function() {
	var a = function() {
			document.location.href = "/Home/Index"
		};
	if (EF.Frontrunner.Activity.Framework.Assessment._timeRemain == 0) {
		EF.Frontrunner.Activity.Framework.Assessment._showTimeoutWindow(a)
	}
	var b = setInterval(function() {
		EF.Frontrunner.Activity.Framework.Assessment._timeRemain = EF.Frontrunner.Activity.Framework.Assessment._timeRemain - 1;
		EF.Frontrunner.Activity.Framework.Assessment._setTimeRemain(EF.Frontrunner.Activity.Framework.Assessment._timeRemain);
		if (EF.Frontrunner.Activity.Framework.Assessment._timeRemain == 0) {
			clearInterval(b);
			EF.Frontrunner.Activity.Framework.Assessment._showTimeoutWindow(a)
		}
	}, 1000);
	return b
};
EF.Frontrunner.Activity.Framework.Assessment._setTimeRemain = function(a) {
	var d = EF.Frontrunner.Activity.Common.changeSecsToMinSecs(a).replace(":", " ");
	var b = d.split("");
	for (var c = 0; c < b.length; c++) {
		$("#act_tr_content span").eq(c).text(b[c])
	}
};
EF.Frontrunner.Activity.Framework.Assessment._showTimeoutWindow = function(a) {
	EF.Frontrunner.ActivityManager.Controller.showTimeoutMessage()
};
EF.Frontrunner.Activity.Framework.Assessment._register = function() {
	EF.Frontrunner.Activity.Framework.Assessment.events._registerControlBarButtonClick();
	EF.Frontrunner.Activity.Framework.Assessment.events._registerControlBarButtonHover();
	EF.Frontrunner.Activity.Framework.Assessment.events._registerControlBarButtonMouse();
	EF.Frontrunner.Activity.Framework.Assessment.events._registerBodyClickAfterPopup()
};
EF.Frontrunner.Activity.Framework.Assessment._initTextAndCss = function() {
	$("#act_title_help span a").text(EF.Frontrunner.Activity.Const.help);
	$("#act_btn_submit span").text(EF.Frontrunner.Activity.Const.submit);
	$("#act_btn_next span").text(EF.Frontrunner.Activity.Const.next);
	$("#act_waiting").text(EF.Frontrunner.Activity.Const.waiting);
	$("#act_submit_popup span").text(EF.Frontrunner.Activity.Const.popupmessage);
	$("#act_tr_title").text(EF.Frontrunner.Activity.Const.timeremain);
	$("#act_resubmit_popup span").text(EF.Frontrunner.Activity.Const.resubmitpopupmessage)
};
EF.Frontrunner.Activity.Framework.Assessment.events._registerControlBarButtonClick = function() {
	$("#act_btn_submit").bind("mousedown", function(a) {
		a.cancelBubble = true;
		a.stopPropagation();
		a.preventDefault()
	});
	$("#act_btn_submit").click(function(b) {
		var a = "";
		b.cancelBubble = true;
		b.stopPropagation();
		b.preventDefault();
		EF.Frontrunner.Activity.Framework.Assessment._submit()
	})
};
EF.Frontrunner.Activity.Framework.Assessment.events._registerControlBarButtonHover = function() {
	$("#act_btn_submit").hover(function() {
		$(this).removeClass("act_btn_submitnext_active");
		$(this).addClass("act_btn_submitnext_hover")
	}, function() {
		$(this).removeClass("act_btn_submitnext_hover");
		$(this).addClass("act_btn_submitnext_active")
	});
	$("#act_btn_next").hover(function() {
		$(this).removeClass("act_btn_submitnext_active");
		$(this).addClass("act_btn_submitnext_hover")
	}, function() {
		$(this).removeClass("act_btn_submitnext_hover");
		$(this).addClass("act_btn_submitnext_active")
	})
};
EF.Frontrunner.Activity.Framework.Assessment.events._registerControlBarButtonMouse = function() {
	$("#act_btn_submit").mousedown(function(a) {
		$(this).removeClass("act_btn_submitnext_hover");
		$(this).addClass("act_btn_submitnext_clicked")
	});
	$("#act_btn_submit").mouseup(function(a) {
		$(this).removeClass("act_btn_submitnext_clicked");
		$(this).addClass("act_btn_submitnext_hover")
	});
	$("#act_btn_next").mousedown(function(a) {
		$(this).removeClass("act_btn_submitnext_hover");
		$(this).addClass("act_btn_submitnext_clicked")
	});
	$("#act_btn_next").mouseup(function(a) {
		$(this).removeClass("act_btn_submitnext_clicked");
		$(this).addClass("act_btn_submitnext_hover")
	})
};
EF.Frontrunner.Activity.Framework.Assessment.events._registerBodyClickAfterPopup = function() {
	$("body").unbind("click mousedown");
	$("body").bind("click mousedown", function() {
		if (!$("#act_submit_popup").hasClass("act_hide")) {
			$("#act_submit_popup").addClass("act_hide")
		}
	})
};
EF.Frontrunner.Activity.Framework.Presentation = {
	models: {},
	events: {},
	handlers: {},
	behaviors: {}
};
EF.Frontrunner.Activity.Framework.Presentation.models = {
	startTime: undefined,
	endTime: undefined,
	timeElapsed: undefined,
	_startTime: undefined,
	_endTime: undefined
};
EF.Frontrunner.Activity.Framework.Presentation.initial = function(b, d) {
	var c = $("#activity");
	var a = EF.Frontrunner.Activity.ServerConst.presentation_framework_url;
	EF.Frontrunner.Activity.Common.loadTemplate(c, a, b, null, {
		filter_data: false
	});
	if (d != null) {
		d()
	}
	EF.Frontrunner.Activity.Framework.Presentation._register();
	EF.Frontrunner.Activity.Framework.Presentation._initTextAndCss();
	EF.Frontrunner.Activity.Framework.Presentation.models._startTime = EF.Frontrunner.Activity.Common.Clock.getCurrentDate();
	EF.Frontrunner.Activity.Framework.Presentation.models.startTime = EF.Frontrunner.Activity.Framework.Presentation.models._startTime.format("yyyy-MM-dd hh:mm:ss")
};
EF.Frontrunner.Activity.Framework.Presentation.showScoreAndMessage = function(a, b, e, d, c) {
	return
};
EF.Frontrunner.Activity.Framework.Presentation._register = function() {
	EF.Frontrunner.Activity.Framework.Presentation.events._registerControlBarButtonClick();
	EF.Frontrunner.Activity.Framework.Presentation.events._registerControlBarButtonHover();
	EF.Frontrunner.Activity.Framework.Presentation.events._registerControlBarButtonMouse()
};
EF.Frontrunner.Activity.Framework.Presentation._initTextAndCss = function() {
	$("#act_title_help span a").text(EF.Frontrunner.Activity.Const.help);
	$("#act_btn_next span").text(EF.Frontrunner.Activity.Const.next)
};
EF.Frontrunner.Activity.Framework.Presentation.events._registerControlBarButtonClick = function() {
	$("#act_btn_next").click(function(a) {
		EF.Frontrunner.Activity.ProcessManager.submit()
	})
};
EF.Frontrunner.Activity.Framework.Presentation.events._registerControlBarButtonHover = function() {
	$("#act_btn_next").hover(function() {
		$(this).removeClass("act_btn_submitnext_active");
		$(this).addClass("act_btn_submitnext_hover")
	}, function() {
		$(this).removeClass("act_btn_submitnext_hover");
		$(this).addClass("act_btn_submitnext_active")
	})
};
EF.Frontrunner.Activity.Framework.Presentation.events._registerControlBarButtonMouse = function() {
	$("#act_btn_next").mousedown(function(a) {
		$(this).removeClass("act_btn_submitnext_hover");
		$(this).addClass("act_btn_submitnext_clicked")
	});
	$("#act_btn_next").mouseup(function(a) {
		$(this).removeClass("act_btn_submitnext_clicked");
		$(this).addClass("act_btn_submitnext_hover")
	})
};
EF.Frontrunner.ActivityManager = EF.Frontrunner.ActivityManager || {};
EF.Frontrunner.ActivityManager.Interface = EF.Frontrunner.ActivityManager.Interface || {};
EF.Frontrunner.ActivityManager.Interface = {
	nextButtonClicked: false,
	nextActivityLoaded: true,
	activityContent: {},
	timer: null
};
EF.Frontrunner.ActivityManager.Interface.submitActivity = function(a) {
	timer = new Date();
	console.log(JSON.stringify(a));
	EF.Frontrunner.Activity.Interface.saveDataSuccess()
};
EF.Frontrunner.ActivityManager.Interface.nextActivity = function() {
	if (EF.Frontrunner.Activity.Common.isDebug) {
		alert("debug mode for next!");
		return
	}
	EF.Frontrunner.ActivityManager.Interface.nextButtonClicked = true;
	dataIndex++;
	if (dataIndex >= JSONDatas.length) {
		alert("This is the max length of the test data!");
		return
	}
	EF.Frontrunner.ActivityManager.Interface.activityContent = JSONDatas[dataIndex];
	if (EF.Frontrunner.ActivityManager.Interface.nextActivityLoaded) {
		EF.Frontrunner.ActivityManager.Interface._startActivity();
		EF.Frontrunner.ActivityManager.Interface._resetData()
	}
};
EF.Frontrunner.ActivityManager.Interface.callback = function(a) {
	EF.Frontrunner.ActivityManager.Interface._activityContentLoaded(a)
};
EF.Frontrunner.ActivityManager.Interface._activityContentLoaded = function(a) {
	EF.Frontrunner.ActivityManager.Interface.timer = new Date() - EF.Frontrunner.ActivityManager.Interface.timer;
	if ($("#testInfo")) {
		$("#testInfo").append("SubmitComplete!<br/>(" + timer * 0.001 + " seconds)<br/>-----<br/>")
	}
	EF.Frontrunner.ActivityManager.Interface.nextActivityLoaded = true;
	EF.Frontrunner.ActivityManager.Interface.activityContent = a;
	if (nextButtonClicked) {
		EF.Frontrunner.ActivityManager.Interface._startActivity();
		EF.Frontrunner.ActivityManager.Interface._resetData()
	}
};
EF.Frontrunner.ActivityManager.Interface._startActivity = function() {
	if (EF.Frontrunner.Activity.Interface) {
		EF.Frontrunner.Activity.Interface.ready(EF.Frontrunner.ActivityManager.Interface.activityContent)
	} else {
		if ($("#testInfo")) {
			$("#testInfo").append("Can't find 'EF.Frontrunner.Activity.Interface!'<br/>-----<br/>")
		}
	}
};
EF.Frontrunner.ActivityManager.Interface._resetData = function() {
	nextButtonClicked = false;
	nextActivityLoaded = false;
	activityContent = null
};
EF.Frontrunner.Activity.Interface.ready = function(a) {
	EF.Frontrunner.Activity.ProcessManager.ready(EF.Frontrunner.Activity.Common.cloneJSON(a))
};
EF.Frontrunner.Activity.Interface.saveDataSuccess = function() {
	EF.Frontrunner.Activity.ProcessManager.showNext()
};
EF.Frontrunner.Activity.Interface.saveDataError = function(a) {
	EF.Frontrunner.Activity.ProcessManager.showResubmit(a)
};
EF.Frontrunner.Activity.ProcessManager = EF.Frontrunner.Activity.ProcessManager || {};
EF.Frontrunner.Activity.ProcessManager = {
	startActivity: function(a) {},
	next: function(a) {},
	submit: function(a) {},
	key: function(a) {},
	check: function(a) {}
};
EF.Frontrunner.Activity.ProcessManager.currentActivity = null;
EF.Frontrunner.Activity.ProcessManager.ready = function(a) {
	$("#activity").html("<div id='act_loading'><img src='/Content/images/loading.gif'>Loading activity content......</div>");
	EF.Frontrunner.Activity.ProcessManager._loadScript(a)
};
EF.Frontrunner.Activity.ProcessManager._loadBackground = function() {
	if ($("#ef_bg").css("background-image") === "none") {
		var b = "_images/page_bg.png";
		var a = $("<img />");
		a.load(function() {
			$("#ef_bg").css({
				"background-image": "url(" + b + ")"
			})
		});
		a.attr("src", b)
	}
};
EF.Frontrunner.Activity.ProcessManager._loadScript = function(a) {
	switch (a.Common.FrameworkType) {
	case "Standard":
		EF.Frontrunner.Activity.ProcessManager.currentFramework = EF.Frontrunner.Activity.Framework.Standard;
		break;
	case "Writing":
		EF.Frontrunner.Activity.ProcessManager.currentFramework = EF.Frontrunner.Activity.Framework.Writing;
		break;
	case "Assessment":
		EF.Frontrunner.Activity.ProcessManager.currentFramework = EF.Frontrunner.Activity.Framework.Assessment;
		break;
	case "Presentation":
		EF.Frontrunner.Activity.ProcessManager.currentFramework = EF.Frontrunner.Activity.Framework.Presentation;
		break;
	default:
		alert("Your activity has invalid framework type.");
		break
	}
	if (EF.Frontrunner.Activity.Framework.Assessment && EF.Frontrunner.Activity.Framework.Assessment.models.timerID) {
		clearInterval(EF.Frontrunner.Activity.Framework.Assessment.models.timerID)
	}
	EF.Frontrunner.Activity.ProcessManager.currentActivity = null;
	var b = EF.Frontrunner.Activity.ServerConst.activityResourceURL;
	switch (a.Common.ActivityType) {
	case "Matching":
		EF.Frontrunner.Activity.Common.loadScript("EF.Frontrunner.Activity.Matching.js", function() {
			EF.Frontrunner.Activity.ProcessManager.currentActivity = EF.Frontrunner.Activity.Matching;
			EF.Frontrunner.Activity.ProcessManager._startActivity(a)
		});
		break;
	case "See Picture And Write":
		EF.Frontrunner.Activity.Common.loadScript("EF.Frontrunner.Activity.SeePictureAndWrite.js", function() {
			EF.Frontrunner.Activity.ProcessManager.currentActivity = EF.Frontrunner.Activity.SeePictureAndWrite;
			a.Content.ReferenceImage = b + a.Content.ReferenceImage;
			EF.Frontrunner.Activity.ProcessManager._startActivity(a)
		});
		break;
	case "Read and Short Answer":
		EF.Frontrunner.Activity.Common.loadScript("EF.Frontrunner.Activity.ReadAndShortAnswer.js", function() {
			EF.Frontrunner.Activity.ProcessManager.currentActivity = EF.Frontrunner.Activity.ReadAndShortAnswer;
			EF.Frontrunner.Activity.ProcessManager._startActivity(a)
		});
		break;
	case "Read and Write":
		EF.Frontrunner.Activity.Common.loadScript("EF.Frontrunner.Activity.ReadAndWrite.js", function() {
			EF.Frontrunner.Activity.ProcessManager.currentActivity = EF.Frontrunner.Activity.ReadAndWrite;
			EF.Frontrunner.Activity.ProcessManager._startActivity(a)
		});
		break;
	case "Gap Fill":
		EF.Frontrunner.Activity.Common.loadScript("EF.Frontrunner.Activity.GapFill.js", function() {
			EF.Frontrunner.Activity.ProcessManager.currentActivity = EF.Frontrunner.Activity.GapFill;
			EF.Frontrunner.Activity.ProcessManager._startActivity(a)
		});
		break;
	case "Read and multiple choice":
		EF.Frontrunner.Activity.Common.loadScript("EF.Frontrunner.Activity.ReadAndMultipleChoice.js", function() {
			EF.Frontrunner.Activity.ProcessManager.currentActivity = EF.Frontrunner.Activity.ReadAndMultipleChoice;
			EF.Frontrunner.Activity.ProcessManager._startActivity(a)
		});
		break;
	case "Multiple Choice":
		EF.Frontrunner.Activity.Common.loadScript("EF.Frontrunner.Activity.MultipleChoice.js", function() {
			EF.Frontrunner.Activity.ProcessManager.currentActivity = EF.Frontrunner.Activity.MultipleChoice;
			EF.Frontrunner.Activity.ProcessManager._startActivity(a)
		});
		break;
	case "Listen and Gap Fill":
		EF.Frontrunner.Activity.Common.loadScript("EF.Frontrunner.Activity.ListenAndGapFill.js", function() {
			EF.Frontrunner.Activity.ProcessManager.currentActivity = EF.Frontrunner.Activity.ListenAndGapFill;
			for (var c = 0; c < a.Content.Audio.length; c++) {
				a.Content.Audio[c].Url = b + a.Content.Audio[c].Url
			}
			EF.Frontrunner.Activity.ProcessManager._startActivity(a)
		});
		break;
	case "Read And High Light":
		EF.Frontrunner.Activity.Common.loadScript("EF.Frontrunner.Activity.ReadAndHighLight.js", function() {
			EF.Frontrunner.Activity.ProcessManager.currentActivity = EF.Frontrunner.Activity.ReadAndHighLight;
			EF.Frontrunner.Activity.ProcessManager._startActivity(a)
		});
		break;
	case "Listen and Choose":
		EF.Frontrunner.Activity.Common.loadScript("EF.Frontrunner.Activity.ListenAndChoose.js", function() {
			EF.Frontrunner.Activity.ProcessManager.currentActivity = EF.Frontrunner.Activity.ListenAndChoose;
			a.Content.ReferenceImage = b + a.Content.ReferenceImage;
			for (var c = 0; c < a.Content.Audio.length; c++) {
				a.Content.Audio[c].Url = b + a.Content.Audio[c].Url
			}
			EF.Frontrunner.Activity.ProcessManager._startActivity(a)
		});
		break;
	case "Listen and Short Answer":
		EF.Frontrunner.Activity.Common.loadScript("EF.Frontrunner.Activity.ListenAndShortAnswer.js", function() {
			EF.Frontrunner.Activity.ProcessManager.currentActivity = EF.Frontrunner.Activity.ListenAndShortAnswer;
			a.Content.ReferenceImage = b + a.Content.ReferenceImage;
			for (var c = 0; c < a.Content.Audio.length; c++) {
				a.Content.Audio[c].Url = b + a.Content.Audio[c].Url
			}
			EF.Frontrunner.Activity.ProcessManager._startActivity(a)
		});
		break;
	case "Matching Text to Images with Audio":
		EF.Frontrunner.Activity.Common.loadScript("EF.Frontrunner.Activity.MatchingTextToImageWithAudio.js", function() {
			EF.Frontrunner.Activity.ProcessManager.currentActivity = EF.Frontrunner.Activity.MatchingTextToImageWithAudio;
			for (var d = 0; d < a.Content.Medias.length; d++) {
				a.Content.Medias[d].Image = b + a.Content.Medias[d].Image;
				if (a.Content.Medias[d].Audio) {
					for (var c = 0; c < a.Content.Medias[d].Audio.length; c++) {
						a.Content.Medias[d].Audio[c].Url = b + a.Content.Medias[d].Audio[c].Url
					}
				}
			}
			EF.Frontrunner.Activity.ProcessManager._startActivity(a)
		});
		break;
	case "Listen and Complete Chart":
		EF.Frontrunner.Activity.Common.loadScript("EF.Frontrunner.Activity.ListenAndCompleteChart.js", function() {
			EF.Frontrunner.Activity.ProcessManager.currentActivity = EF.Frontrunner.Activity.ListenAndCompleteChart;
			for (var c = 0; c < a.Content.Audio.length; c++) {
				a.Content.Audio[c].Url = b + a.Content.Audio[c].Url
			}
			EF.Frontrunner.Activity.ProcessManager._startActivity(a)
		});
		break;
	case "Listen And Match":
		EF.Frontrunner.Activity.Common.loadScript("EF.Frontrunner.Activity.ListenAndMatch.js", function() {
			EF.Frontrunner.Activity.ProcessManager.currentActivity = EF.Frontrunner.Activity.ListenAndMatch;
			for (var e = 0; e < a.Content.Images.length; e++) {
				a.Content.Images[e] = b + a.Content.Images[e]
			}
			for (var d = 0; d < a.Content.Medias.length; d++) {
				for (var c = 0; c < a.Content.Medias[d].Audio.length; c++) {
					a.Content.Medias[d].Audio[c].Url = b + a.Content.Medias[d].Audio[c].Url
				}
			}
			EF.Frontrunner.Activity.ProcessManager._startActivity(a)
		});
		break;
	case "Categorization":
		EF.Frontrunner.Activity.Common.loadScript("EF.Frontrunner.Activity.Categorization.js", function() {
			EF.Frontrunner.Activity.ProcessManager.currentActivity = EF.Frontrunner.Activity.Categorization;
			EF.Frontrunner.Activity.ProcessManager._startActivity(a)
		});
		break;
	case "Presentation":
		EF.Frontrunner.Activity.Common.loadScript("EF.Frontrunner.Activity.Presentation.js", function() {
			EF.Frontrunner.Activity.ProcessManager.currentActivity = EF.Frontrunner.Activity.Presentation;
			for (var c = 0; c < a.Content.Images.length; c++) {
				a.Content.Images[c].Url = b + a.Content.Images[c].Url
			}
			EF.Frontrunner.Activity.ProcessManager._startActivity(a)
		});
		break;
	case "Unscrumb":
		EF.Frontrunner.Activity.Common.loadScript("EF.Frontrunner.Activity.Unscrumb.js", function() {
			EF.Frontrunner.Activity.ProcessManager.currentActivity = EF.Frontrunner.Activity.Unscrumb;
			EF.Frontrunner.Activity.ProcessManager._startActivity(a)
		});
		break;
	case "FlashCard":
		EF.Frontrunner.Activity.Common.loadScript("EF.Frontrunner.Activity.FlashCard.js", function() {
			EF.Frontrunner.Activity.ProcessManager.currentActivity = EF.Frontrunner.Activity.FlashCard;
			for (var d = 0; d < a.Content.Medias.length; d++) {
				a.Content.Medias[d].Image = b + a.Content.Medias[d].Image;
				if (a.Content.Medias[d].Audio) {
					for (var c = 0; c < a.Content.Medias[d].Audio.length; c++) {
						a.Content.Medias[d].Audio[c].Url = b + a.Content.Medias[d].Audio[c].Url
					}
				}
			}
			EF.Frontrunner.Activity.ProcessManager._startActivity(a)
		});
		break;
	case "Sequence":
		EF.Frontrunner.Activity.Common.loadScript("EF.Frontrunner.Activity.Sequence.js", function() {
			EF.Frontrunner.Activity.ProcessManager.currentActivity = EF.Frontrunner.Activity.Sequence;
			EF.Frontrunner.Activity.ProcessManager._startActivity(a)
		});
		break;
	case "Video and Multiple Answer":
		EF.Frontrunner.Activity.Common.loadScript("EF.Frontrunner.Activity.VideoAndMultipleAnswer.js", function() {
			EF.Frontrunner.Activity.ProcessManager.currentActivity = EF.Frontrunner.Activity.VideoAndMultipleAnswer;
			for (var c = 0; c < a.Content.video.length; c++) {
				a.Content.video[c].Url = b + a.Content.video[c].Url
			}
			EF.Frontrunner.Activity.ProcessManager._startActivity(a)
		});
		break;
	case "See Picture And Write With Audio":
		EF.Frontrunner.Activity.Common.loadScript("EF.Frontrunner.Activity.SeePictureAndWriteWithAudio.js", function() {
			EF.Frontrunner.Activity.ProcessManager.currentActivity = EF.Frontrunner.Activity.SeePictureAndWriteWithAudio;
			a.Content.ReferenceImage = b + a.Content.ReferenceImage;
			for (var c = 0; c < a.Content.Audio.length; c++) {
				a.Content.Audio[c].Url = b + a.Content.Audio[c].Url
			}
			EF.Frontrunner.Activity.ProcessManager._startActivity(a)
		});
		break;
	case "Read and Write with Audio":
		EF.Frontrunner.Activity.Common.loadScript("EF.Frontrunner.Activity.ReadAndWriteWithAudio.js", function() {
			EF.Frontrunner.Activity.ProcessManager.currentActivity = EF.Frontrunner.Activity.ReadAndWriteWithAudio;
			for (var c = 0; c < a.Content.Audio.length; c++) {
				a.Content.Audio[c].Url = b + a.Content.Audio[c].Url
			}
			EF.Frontrunner.Activity.ProcessManager._startActivity(a)
		});
		break;
	default:
		alert("Your activity has invalid activity type.");
		break
	}
};
EF.Frontrunner.Activity.ProcessManager._startActivity = function(a) {
	EF.Frontrunner.Activity.ProcessManager.currentActivity.ready(a);
	EF.Frontrunner.Activity.Common.fitBackgroundHeight();
	if (EF_FR_Common) {
		EF_FR_Common.checkFooter()
	}
};
EF.Frontrunner.Activity.ProcessManager.next = function(a) {
	EF.Frontrunner.Activity.ProcessManager.currentActivity = null;
	EF.Frontrunner.ActivityManager.Interface.nextActivity()
};
EF.Frontrunner.Activity.ProcessManager.submit = function(a) {
	EF.Frontrunner.Activity.ProcessManager.currentActivity.submit(a)
};
EF.Frontrunner.Activity.ProcessManager.key = function(a) {
	EF.Frontrunner.Activity.ProcessManager.currentActivity.key(a)
};
EF.Frontrunner.Activity.ProcessManager.check = function(a) {
	EF.Frontrunner.Activity.ProcessManager.currentActivity.check(a)
};
EF.Frontrunner.Activity.ProcessManager.showNext = function() {
	var a = EF.Frontrunner.Activity.ProcessManager.currentActivity.models.source.Common.FrameworkType;
	if (a == "Assessment" || a == "Presentation") {
		EF.Frontrunner.ActivityManager.Interface.nextActivity()
	} else {
		$("#act_btn_submit").hide();
		$("#act_btn_next").show()
	}
};
EF.Frontrunner.Activity.ProcessManager.showResubmit = function(a) {
	$("#act_btn_submit span").html(EF.Frontrunner.Activity.Const.resubmit);
	$("#act_btn_submit").show();
	$("#act_resubmit_popup").removeClass("act_hide");
	$("#act_btn_submit").bind("click", function() {
		$("#act_btn_submit").unbind("click");
		$("#act_resubmit_popup").addClass("act_hide");
		$("#act_btn_submit span").html(EF.Frontrunner.Activity.Const.waiting);
		EF.Frontrunner.Activity.Common.uploadDataToServer(a)
	})
};​